package com.qf.service.impl;

import com.qf.mapper.GoodsCategoryMapper;
import com.qf.pojo.GoodsCategory;
import com.qf.service.GoodsCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author Mr.Shang
 * @version 1.0
 * @date 2021/9/22 16:39
 * @Description 商品小分类服务实现类
 */
@Repository
public class GoodsCategoryServiceImpl implements GoodsCategoryService {
    @Autowired
    private GoodsCategoryMapper goodsCategoryMapper;

    public List<GoodsCategory> findAll() {
        return goodsCategoryMapper.findAll();
    }

    @Override
    public void deleteById(Integer id) {
        goodsCategoryMapper.deleteByPrimaryKey(id);
    }

    @Override
    public void updateGoods(GoodsCategory goodsCategory) {
        goodsCategoryMapper.updateByPrimaryKeySelective(goodsCategory);
    }

    @Override
    public void addGoods(GoodsCategory goodsCategory) {
        goodsCategoryMapper.insertSelective(goodsCategory);
    }

    @Override
    public List<String> findClass() {
        return goodsCategoryMapper.findClass();
    }
}
